<?php
include "../../fun.php";
$db=conndb();
isLogin();
$company=$_POST["company"]; //获取索引
$contactUs=$_POST["contactUs"];
$phone=$_POST["phone"];
$contact=$_POST["contact"];
$QQ=$_POST["QQ"];
$email=$_POST["email"];
$address=$_POST["address"];
$copyright=$_POST["copyright"];
$recorderNumber=$_POST["recorderNumber"];
$pic=$_POST["pic"];
$id=isset($_POST["id"])?$_POST["id"]:'';
if ($id) {
    $sql="update sysset set company='{$company}',logo='{$pic}',contactUs='{$contactUs}',phone='{$phone}',contact='{$contact}',QQ='{$QQ}',email='{$email}',address='{$address}',copyright='{$copyright}',recorderNumber='{$recorderNumber}' where id='{$id}'";
} else {
    $sql="insert into sysset (company,logo,contactUs,phone,contact,QQ,email,address,copyright,recorderNumber) values ('{$company}','{$pic}','{$contactUs}','{$phone}','{$contact}','{$QQ}','{$email}','{$address}','{$copyright}','{$recorderNumber}')";
}
$db->exec($sql);
$data=["code"=>0,"msg"=>"操作成功"];
echo json_encode($data, JSON_UNESCAPED_UNICODE);
